//
//  TransactionRecordsVC.m
//  Logistics
//
//  Created by enzhoukeji on 2018/8/10.
//  Copyright © 2018年 puyue.com. All rights reserved.
//

#import "TransactionRecordsVC.h"
#import "RecordsOedrtTVCell.h"
#import "BillingDetailsVC.h"
@interface TransactionRecordsVC ()<UITableViewDelegate,UITableViewDataSource>
@property (nonatomic,strong) UITableView *recordsTV;

@end

@implementation TransactionRecordsVC
-(UITableView *)recordsTV{
    if (!_recordsTV) {
        _recordsTV = [[UITableView alloc]initWithFrame:CGRectMake(0,  kMainTopHeight, kMainScreen_width , kMainScreen_height-kMainTopHeight - GTFixHeightFlaot(37)) style:UITableViewStylePlain];
        _recordsTV.showsVerticalScrollIndicator = NO;
        _recordsTV.dataSource = self;
        _recordsTV.delegate = self;
    }
    return _recordsTV;
}
- (void)viewDidLoad {
    [super viewDidLoad];
    self.navTitle = @"交易记录";
    [self.view addSubview:self.recordsTV];
    // Do any additional setup after loading the view.
}
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    return 3;
}
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    RecordsOedrtTVCell *cell=[tableView dequeueReusableCellWithIdentifier:@"RecordsOedrtTVCell"];
    if (!cell) {
        cell=[[RecordsOedrtTVCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"RecordsOedrtTVCell"];
    }
    return cell;
}
-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
    return GTFixHeightFlaot(70);
}
-(void)viewDidLayoutSubviews {
    
    if ([self.recordsTV respondsToSelector:@selector(setSeparatorInset:)]) {
        [self.recordsTV setSeparatorInset:UIEdgeInsetsZero];
    }
    if ([self.recordsTV respondsToSelector:@selector(setLayoutMargins:)])  {
        [self.recordsTV setLayoutMargins:UIEdgeInsetsZero];
    }
}
-(void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPat{
    if ([cell respondsToSelector:@selector(setLayoutMargins:)]) {
        [cell setLayoutMargins:UIEdgeInsetsZero];
    }
    if ([cell respondsToSelector:@selector(setSeparatorInset:)]){
        [cell setSeparatorInset:UIEdgeInsetsZero];
    }
}
-(UIView*)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section {
    return nil;
}
-(CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section {
    return 1;
}
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
    BillingDetailsVC * vc = [BillingDetailsVC new];
    [self.navigationController pushViewController:vc animated:YES];
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
